package com.sxit.ecwx.core.utils;

import java.io.InputStream;
import java.util.Properties;

public class ErrorCodeSupport {
	//异常编码信息
	public final static int correct_code=200;  
	
	
	private static String errorCodeConfig="ErrorCodeSupport.properties";
	
	
	/**
	 * 功能说明：根据错误编码key获取value
	 * @param key
	 * @return
	 */
	public static String readValue(String key){
		Properties p=new Properties();
		try {
			InputStream profile=Thread.currentThread().getContextClassLoader().getResourceAsStream(errorCodeConfig);
			p.load(profile);
			String value=p.getProperty(key);
			profile.close();
			return value;
		} catch (Exception e) {
			System.out.println("execute ErrorCodeSupport.properties error");
			return null;
		}
	}
	
	public static void main(String[] args) {
		String key="200";
		System.out.println(ErrorCodeSupport.readValue(key));
	}

}
